import java.util.Iterator;
import java.util.Scanner;
import java.util.SortedSet;
import java.util.TreeSet;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Administrator
 * Date: 2023-04-19
 * Time: 17:03
 */
public class Student {
    public static void main(String[] args) {
        TreeSet<Double> setScores = new TreeSet<>();
        Scanner scan = new Scanner(System.in);
        System.out.println("***********学生成绩管理系统***********");
        for (int i = 0; i < 5; i++) {
            System.out.println("第"+(i+1)+"个学生成绩：");
            double score = scan.nextDouble();
            setScores.add(score);
        }
        Iterator<Double> it = setScores.iterator();
        System.out.println("学生成绩从低到高排序为：");
        while (it.hasNext()){
            System.out.println(it.next()+"\t");
        }
        SortedSet<Double> score1 = setScores.headSet(60.0);
        System.out.println("\n不及格（小于60分）的成绩有：");
        for (int i = 0; i < score1.toArray().length; i++) {
            System.out.println(score1.toArray()[i]+"\t");
        }
        SortedSet<Double> score2 = setScores.tailSet(90.0);
        System.out.println("\n90分以上的成绩有：");
        for (int i = 0; i < score2.toArray().length; i++) {
            System.out.println(score2.toArray()[i]+"\t");
        }
        scan.close();
    }
}
